import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgZorroAntdModule, NzMessageService } from 'ng-zorro-antd';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AddComponent } from './add/add.component';
import { MainLayoutModule } from '../../comm-components/main-layout/main-layout.module';
import { EditComponent } from './edit/edit.component';
import { DisplayComponent } from "./display.component";
import { routing } from './display-routing.module';
import { InputDelComponent } from "./inputDel.component";
import { UploadComponent } from './upload/upload.component';
import { ViewComponent } from './view/view.component';
import { GroupService } from "../group/group.service";
import { DisplayService } from "./display.service";
import { HttpService } from "../../lib/service/http.service";
import { LocalStorageService } from "../../lib/service/local-storage.service";
import { DisplayGuard } from "./displayGuard";
import { Add1Component } from './add1/add1.component';
import { Edit1Component } from './edit1/edit1.component';
import { ListComponent } from './list/list.component';


@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    routing,
    NgZorroAntdModule.forRoot(),
    MainLayoutModule,
  ],
  declarations: [
    DisplayComponent,
    AddComponent,
    EditComponent,
    InputDelComponent,
    UploadComponent,
    ViewComponent,
    Add1Component,
    Edit1Component,
    ListComponent
  ],

  providers: [
    {
      provide: DisplayService,
      deps: [HttpService, LocalStorageService],
      useFactory(http: HttpService, localStorage: LocalStorageService) {
        return new DisplayService(http, localStorage);
      }
    },
    DisplayGuard,
  ]
})
export class DisplayModule { }

